<template>
  <div class="fullelements">
    <indexhead></indexhead>

    <div style="height:570px;background-color: rgba(0, 0, 0, 0.1);;border-bottom-right-radius: 3px;
    border-bottom-left-radius: 3px;overflow:hidden;">
    
      <el-row type="flex" style="padding: 5px;height:50px;">
        <el-col :span="12" class="coltop">
          <router-link :to="{ path: '/index' }">
            <i class="iconfont icon-zuixinwenti daohang aicon" v-bind:class="{ selected: $route.path === '/index' }"></i>
          </router-link>
        </el-col>
        <el-col :span="12" class="coltop">
          <router-link :to="{ path: '/homeindex' }">
            <i class="iconfont icon-shouye3 daohang aicon" v-bind:class="{ selected: $route.path === '/homeindex' }"></i>
          </router-link>
        </el-col>
      </el-row>

      <transition name="fade">
        <router-view></router-view>
      </transition>
      <div>
        <login></login>
        <register></register>
      </div>
    </div>   
    
  </div>
</template>

<script>
import login from '@/components/login'
import register from '@/components/register'
import indexhead from '@/components/public/indexhead'
export default {
  name: 'main',
  data () {
    return {
      router: true
    }
  },
  methods: {
    openwin: function () {
      this.H.openwin('/square', 'square', true)
    },
    openbrowser: function () {
      this.H.openwin('/browser', 'browser')
    }
  },
  mounted: function () {
    let that = this
    // 监听关闭
    this.H.electron.ipcRenderer.on('deletelocalstorage', (event, message) => {
      if (message) {
        that.H.SL('userinfo')
        that.H.sendstore('userinfo', {})
      }
      that.H.electron.ipcRenderer.send('appquitnow', true)
    })
  },
  components: { login, register, indexhead }
}
</script>

<style scoped>
.fade-enter-active{
    transition: opacity .5s;
}
.fade-enter{
   opacity: 0;
}
.daohang{
  font-size:25px;
}
.coltop{
  height: 40px;
  line-height: 40px;
}
.coltops{
  height: 30px;
  line-height: 30px;
}
.selected{
  color:#15af22;
}
</style>
